package com.luckeys.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.luckeys.dao.CityDao;
import com.luckeys.ios.vo.IosCityVO;
import com.luckeys.service.CityService;
import com.luckeys.vo.CityVO;
import com.luckeys.vo.PageVO;

/**
 * 型号实现类
 * @author tbh
 *
 */
@Service
public class CityServiceImpl implements CityService {
	@Autowired
	private CityDao cityDao;

	public List<CityVO> queryCityList(CityVO CityVO) {
		return cityDao.queryCityList(CityVO);
	}
	
	public List<IosCityVO> queryIosCityList(CityVO CityVO) {
		return cityDao.queryIosCityList(CityVO);
	}

	public PageVO<CityVO> queryCityPage(CityVO City) {
		PageVO<CityVO> page = new PageVO<CityVO>();
		page.setData(cityDao.queryCityPage(City));
		page.setTotalRecords(cityDao.queryCityCount(City));
		return page;
	}
	
	public PageVO<IosCityVO> queryIosCityPage(CityVO City) {
		PageVO<IosCityVO> page = new PageVO<IosCityVO>();
		page.setData(cityDao.queryIosCityPage(City));
		page.setTotalRecords(cityDao.queryCityCount(City));
		return page;
	}

	public int addCity(CityVO City) {
		return cityDao.addCity(City);
	}

	public int deleteCity(String CityUuid) {
		return cityDao.deleteCity(CityUuid);
	}

	public CityVO queryCityById(String CityUuid) {
		return cityDao.queryCityById(CityUuid);
	}

	public int updateCity(CityVO City) {
		return cityDao.updateCity(City);
	}

}
